package com.myapp.struts.menu;

import java.util.ArrayList;

public class USDinnerXML {

    private static USDinnerXML usDinnerXMLObj;
    ArrayList<FoodItems> usdinnerXMLArray = new ArrayList<FoodItems>();

    public static synchronized USDinnerXML getSingletonObject() {
        if (usDinnerXMLObj == null) {
            usDinnerXMLObj = new USDinnerXML();
        }
        return usDinnerXMLObj;
    }

    public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException();
    }

    public String getUSDinnerXML(String fileLoc) {
        String fileName = "";

        MenuRead menuReadObj = new MenuRead();
        usdinnerXMLArray = menuReadObj.ReadMenu(Constants.US);
        
        MenuGenerate menuGenerateObj = new MenuGenerate();
        usdinnerXMLArray = menuGenerateObj.GenerateMenu(usdinnerXMLArray, Constants.DINNER);

        MenuFormat menuFormatObj = new MenuFormat();
        fileName = menuFormatObj.FormatMenu(usdinnerXMLArray, Constants.XML, fileLoc);
        return fileName;

    }
}
